import Vue from "vue";
import _ from "lodash";

Vue.filter('emptyText', function(value, msg='无数据') {
    if(!value && value!==0) {
        return msg;
    }
    return value;
})

Vue.filter('getText', function(data, path, msg='无数据') {
    return _.get(data, path) || msg;
})